<?php
$r = DB::sql("SELECT * from user");
foreach($r as $result){
	$pfa = $result['pfa'];
	$id = $result['id'];
	$hash_cost_log2 = 8;
	// make hashes non-portable to older systems
	$hash_portable = FALSE;
	// get hasher
	$hasher = new PasswordHash($hash_cost_log2, $hash_portable);
	$hash = $hasher->HashPassword($pfa);
	unset($hasher);
	$param = array('1'=>$hash,'2'=>$id);
	DB::sql("UPDATE user set pfa = ? where id = ?", $param);
}
?>